<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/grsun" prefix="grsun"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<meta name="description" content="Mailbox with some customizations as described in docs" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<%@ include file="/include/main_include.jsp"%>
<%@ include file="/include/form_include.jsp"%>
	<head>
		<script type="text/javascript">
			
			//保存
			function save(){
				if($("#excel").val()=="" || document.getElementById("excel").files[0] =='请选择xls格式的文件'){
					$("#excel").tips({
						side:3,
			            msg:'请选择文件',
			            bg:'#AE81FF',
			            time:3
			        });
					return false;
				}
				
				$("#foodForm").submit();
				
			}
			
			function fileType(obj){
				var fileType=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
			    if(fileType != '.xls'){
			    	$("#excel").tips({
						side:3,
			            msg:'请上传xls格式的文件',
			            bg:'#AE81FF',
			            time:3
			        });
			    	$("#excel").val('');
			    	document.getElementById("excel").files[0] = '请选择xls格式的文件';
			    }
			}
		</script>
	</head>
<body>
	 <div class="modal-body" style="max-height: 716px;">
		<div id="divform" class="row mx-dialog-c bs_dialog open"> 
			<div style="display:none">
				<iframe name="uploadexcel" id="uploadexcel"></iframe>
			</div>
		   <form id="foodForm" class="form-horizontal" method="post" action="${path}/hhFood/readExcel.do" enctype="multipart/form-data" target="uploadexcel">
		   		<input type="hidden" id="businessId" name="businessId" value="${pd.businessId}" />
		   		<div id="zhongxin">
					<table style="width:100%;" >
						<tr>
							<td style="padding-top: 20px;">
							<!-- <input type="file" id="excel" name="excel" style="width:100%;" onchange="fileType(this)" /> -->
							<input class="easyui-filebox" id="excel" name="excel"  onchange="fileType(this)" style="width:100%" buttonText="选择文件">
							</td>
						</tr>
					</table>
				</div>
		   </form>
		 </div>
	 </div>
		<script type="text/javascript">
	$(function() {
		
	});
	</script>
	
</body>
</html>